<template>
  <view class="craftsman-info">
    <view class="page-container">
      <view class="top-name flex flex-between flex-bottom">
        <view class="left">
          王悦颜
          <text> 7.9分 </text>
        </view>
        <view class="right"> 最早可约：今16:30 </view>
      </view>

      <view class="info flex flex-middle flex-between">
        <view class="left flex flex-middle">
          半年接单999+
          <view
            class="tags"
            v-for="(item, index) in ['超多好评', '多人关注']"
            :key="index"
          >
            {{ item }}
          </view>
        </view>
        <view class="right flex flex-middle">
          <u-icon
            class="icon"
            size="16"
            color="#333"
            name="map"
            @click="backClick"
          />
          距离您2.1km
        </view>
      </view>

      <view class="more-info flex flex-middle flex-between">
        <view class="item flex flex-middle flex-center"> 星座：双子座 </view>
        <view class="item flex flex-middle flex-center"> 生肖：猪 </view>
        <view class="item flex flex-middle flex-center"> 年龄：30 </view>
        <view class="item flex flex-middle flex-center"> 身高：161cm </view>
      </view>

      <view class="rich-text-container">
        <view class="title"> 匠人简介 </view>
        <view class="content" :class="{ hide: !showMore }" ref="content">
          熟练掌握多种按摩手法，包括但不限于中式推拿、泰式按摩、瑞典式按摩等。持有国家认证的按摩师资格证书，具备专业的按摩技能和理论知识。深受客户好评，以客户为中心，致力于提供专业、舒适、高效的按摩服务，让每一位客户都能享受轻松与愉悦。熟练掌握多种按摩手法，包括但不限于中式推拿、泰式按摩、瑞典式按摩等。持有国家认证的按摩师资格证书，具备专业的按摩技能和理论知识。深受客户好评，以客户为中心，致力于提供专业、舒适、高效的按摩服务，让每一位客户都能享受轻松与愉悦。
        </view>
        <view
          class="show-more flex flex-middle flex-center"
          @click="showMore = !showMore"
          v-if="120 > 116"
        >
          {{ showMore ? "收起简介" : "展开更多" }}
          <u-icon
            class="icon"
            size="16"
            color="#666"
            :name="showMore ? 'arrow-up' : 'arrow-down'"
          />
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      showMore: false,
    };
  },
};
</script>

<style scoped lang="scss">
.craftsman-info {
  padding: 16px 16px 6px;
  border-bottom: 10px solid #f6f6f6;
}

.show-more {
  font-size: 12px;
  color: #31bc4e;
  height: 28px;

  .icon {
    margin-left: 2px;
  }
}

.rich-text-container {
  margin-top: 18px;

  .hide {
    max-height: 68px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
  }

  .content::after {
    text-align: justify;
  }

  .content {
    border-top: 1px solid #f6f6f6;
    border-bottom: 1px solid #f6f6f6;
    padding: 6px 0;
    line-height: 18px;
    color: #333;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .title {
    color: #333;
    padding-bottom: 10px;
  }
}

.more-info {
  margin-top: 20px;

  .item {
    height: 18px;
    border-radius: 18px;
    background: #f6f6f6;
    color: #333;
    font-size: 10px;
    width: 23%;
  }
}

.info {
  color: #333;
  font-size: 12px;
  margin-top: 12px;

  .icon {
    margin-right: 2px;
  }

  .tags {
    height: 16px;
    list-style: 16px;
    padding: 0 6px;
    color: #ff5500;
    border: 1px solid #ff5500;
    border-radius: 16px;
    font-size: 10px;
    margin-left: 6px;
  }
}

.top-name {
  color: #222;
  font-size: 18px;

  .left {
    text {
      font-size: 13px;
      color: #fa6400;
      margin-left: 6px;
    }
  }

  .right {
    font-size: 12px;
    color: #20b800;
  }
}
</style>